Function.prototype.myApply = function (context, argument = []) {
  if (typeof this !== 'function') {
    throw new TypeError('改函数只能被function类型调用！')
  }
  context = context || window;

  let fn = Symbol()
  context[fn] = this;
  let result = context[fn](...argument);

  delete context[fn]

  return result
}

let a = 1,
  b = 2;

function add(c, d) {
  console.log('a', this.a)
  console.log('b', this.b)
  console.log('c', c)
  console.log('d', d)
  return this.a + this.b + c + d
}

const exmple = {
  a: 2,
  b: 3
}

console.log(add.myCall(exmple, [4, 5]))
console.log(add.myCall(null, [4, 5]))